package com.yc.cloud.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yc.cloud.common.orm.BaseEntity;
import java.io.Serializable;
import java.time.LocalDateTime;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 告警事件记录表
 * </p>
 *
 * @author kinggu
 * @since 2025-07-22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("alarm_record")
public class AlarmRecord extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 告警唯一标识符 (UUID或业务ID)
     */
    @TableField("alarm_uid")
    private String alarmUid;

    /**
     * 关联算法ID (alg_algorithm.id)，代表告警类型
     */
    @TableField("algorithm_id")
    private Long algorithmId;

    /**
     * 告警名称 (冗余自算法名称, 如: 明火, 抽烟)
     */
    @TableField("alarm_name")
    private String alarmName;

    /**
     * 关联硬件设备ID (hw_device.id)
     */
    @TableField("device_id")
    private Long deviceId;

    /**
     * 关联摄像头ID (hw_camera.id)
     */
    @TableField("camera_id")
    private Long cameraId;

    /**
     * 设备位置 (冗余字段, 便于查询)
     */
    @TableField("device_location")
    private String deviceLocation;

    /**
     * 告警发生时间
     */
    @TableField("alarm_time")
    private LocalDateTime alarmTime;

    /**
     * 告警快照图片文件ID（原始图片）
     */
    @TableField("alarm_image_file_id")
    private String alarmImageFileId;
    
    /**
     * 带有检测框标记的告警图片文件ID
     */
    @TableField("alarm_marked_image_file_id")
    private String alarmMarkedImageFileId;

    /**
     * 违规人员用户ID（关联ums_admin.id）
     */
    @TableField("violator_user_id")
    private Long violatorUserId;

    /**
     * 人脸相似度（0-1）
     */
    @TableField("face_similarity")
    private Double faceSimilarity;

    /**
     * 告警视频片段文件ID
     */
    @TableField("alarm_video_file_id")
    private String alarmVideoFileId;

    /**
     * 处理状态: 0-待处理, 1-处理中, 2-已关闭, 3-误报
     */
    @TableField("status")
    private Byte status;

    /**
     * 处理人ID (ums_admin.id)
     */
    @TableField("handler_id")
    private Long handlerId;

    /**
     * 处理完成时间
     */
    @TableField("handle_time")
    private LocalDateTime handleTime;

    /**
     * 处理结果描述
     */
    @TableField("handle_result")
    private String handleResult;

    /**
     * 处理时长(秒)
     */
    @TableField("handle_duration")
    private Integer handleDuration;

    /**
     * 告警级别: 1-一般, 2-警告, 3-紧急
     */
    @TableField("level")
    private Byte level;

    /**
     * 逻辑删除: 0-未删除, 1-已删除
     */
    @TableField("is_deleted")
    private Boolean deleted;

    public static final String AlarmUid = "alarm_uid";
    public static final String AlgorithmId = "algorithm_id";
    public static final String AlarmName = "alarm_name";
    public static final String DeviceId = "device_id";
    public static final String CameraId = "camera_id";
    public static final String DeviceLocation = "device_location";
    public static final String AlarmTime = "alarm_time";
    public static final String AlarmImageFileId = "alarm_image_file_id";
    public static final String AlarmMarkedImageFileId = "alarm_marked_image_file_id";
    public static final String ViolatorUserId = "violator_user_id";
    public static final String FaceSimilarity = "face_similarity";
    public static final String AlarmVideoFileId = "alarm_video_file_id";
    public static final String Status = "status";
    public static final String HandlerId = "handler_id";
    public static final String HandleTime = "handle_time";
    public static final String HandleResult = "handle_result";
    public static final String HandleDuration = "handle_duration";
    public static final String Level = "level";
    public static final String Deleted = "is_deleted";

} 